# -*- coding: utf-8 -*-
# @Time : 2023-12-19
# @Author : DeShun Yang
# @Site : (
# @File : services/search.py
# @Function: search function
# # @Describe: ---

# class rectangle:
#     width = 0
#     height = 0
#     color = ''
#     def __init__(self,width,height,color):
#         self.width = int(width)
#         self.height = int(height)
#         self.color = color
#     def perimeter(self):
#         return (self.height+self.width)*2
#     def area(self):
#         return self.height*self.width

# miao = input("请输入 宽 长 颜色：")
# miaoArray = miao.split(' ')

# rectangleMiao = rectangle(miaoArray[0],miaoArray[1],miaoArray[2])
# print(rectangleMiao.perimeter())
# print(rectangleMiao.area())

#通过information查找匹配的项，并加入到mateItem里

class searchContent:
    
    def searchContentMiao(self,fileArray,information):
        self.mateItem = []
        self.searchTxtContent = information
        self.fileArray = fileArray
        
        for item in self.fileArray:
            txt = ''.join(item)
            if self.searchTxtContent.lower() in txt.lower():
                self.mateItem.append(item)

        if len(self.mateItem)==0:
            return -1

        return self.mateItem
        
        

    
